<extend name="common"/>
<block name="title">用户列表-{:C('web_name')}</block>
<block name="page">
<div class="row">
	<div class="col-xs-12">
		<ol class="breadcrumb">
			<li><a href="/"><span class="hidden-xs">{:C('web_name')}</span><span class="hidden-md hidden-lg">首页</span></a></li>
			<li><a href="{:U('index')}">管理后台</a></li>
			<li class="active">代理用户列表</li>
		</ol>
	</div>
</div>

<div class="row">
	<div class="col-xs-12">
		<ol class="breadcrumb">
		<li style="line-height: 45px;">共{$pages}页</li><li style="line-height: 45px;">{$count}条</li>
		</ol>
	</div>
	<div class="col-xs-12">
		<div class="list-group">
			<div class="list-group-item list-group-item-success">添加代理用户</div>
			<form action="{:U('dllist')}" role="form" class="form-horizontal" method="post"><input type="hidden" name="do" value="add">
			<div class="list-group-item">
				<div class="input-group col-xs-12">
					<div class="input-group-addon"><input type="submit" value="设置">&nbsp;&nbsp;UID:</div>
					<input type="text" class="form-control" name="uid" placeholder="输入用户UID">
					<div class="input-group-addon">用户为代理</div>
				</div>
			</div>
			</form>
		</div>
	</div>
	<div class="col-xs-12">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">代理用户列表</h3>
			</div>
			<br>
			<div class="row" style="padding: 5px;">
				<volist name="list" id="user" key="k">
				<div class="col-xs-12 col-md-3">
					<div class="list-group">
						<h4 class="list-group-item list-group-item-info"><a href="{:U('userset','uid='.$user['uid'])}">UID:{$user.uid}</a><a href="{:U('dllist','do=del&p='.$page.'&uid='.$user['uid'])}" onClick="if(!confirm('确认取消用户:{$user.user}的代理？')){return false;}"><span class="glyphicon glyphicon-remove" aria-hidden="true" style="float:right;"></span></a></h4>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-user" aria-hidden="true">&nbsp;{$user.user}</span>
						</div>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-yen" aria-hidden="true">&nbsp;<font color="red" size="3">{$user.rmb}</font>&nbsp;元</span>
						</div>
						<div class="list-group-item list-group-item-warning">
							<a href="{:U('dllist','do=del&uid='.$user['uid'])}" class="badge" onClick="if(!confirm('确认取消用户:{$user.user}的代理？')){return false;}">取消</a>
							<span class="glyphicon glyphicon-th" aria-hidden="true">&nbsp;<if condition="$user['daili']"><a href="{:U('daili/index')}">普通代理</a><else/>不是代理</if></span>
						</div>
						<div class="list-group-item">
							<form action="{:U('dllist','p='.$page)}" role="form" class="form-horizontal" method="post"><input type="hidden" name="do" value="cz"><input type="hidden" name="uid" value="{$user.uid}">
							<div class="input-group">
								<div class="input-group-addon"><input type="submit" value="充值"></div>
								<input class="form-control" name="rmb" placeholder="输入充值金额" value="0">
								<div class="input-group-addon">元</div>
							</div>
							</form>
						</div>
						<div class="list-group-item">
							<form action="{:U('dllist','p='.$page)}" role="form" class="form-horizontal" method="post"><input type="hidden" name="do" value="kc"><input type="hidden" name="uid" value="{$user.uid}">
							<div class="input-group">
								<div class="input-group-addon"><input type="submit" value="扣除"></div>
								<input class="form-control" name="rmb" placeholder="输入扣除金额" value="0">
								<div class="input-group-addon">元</div>
							</div>
							</form>
						</div>
						<div class="list-group-item">
							<span class="glyphicon glyphicon-time" aria-hidden="true">&nbsp;上次登录:{$user.lasttime}</span>
						</div>
					</div>
				</div>
				</volist>
			</div>
		</div>
	</div>
	<div class="col-xs-12">
		<div class="list-group-item list-group-item-info">
			<ul class="pagination">
			<if condition="$pages gt 1">
				<li><a href="{:U('dllist')}">首页</a></li>
				<for start="$start" end="$end+1">
				<li <if condition="$i eq $page">class="active"</if>><a href="{:U('dllist','p='.$i)}">{$i}</a></li>
				</for>
				<li><a href="{:U('dllist','p='.$pages)}">未页</a></li>
			</if>
			</ul>
		</div>
	</div>
</div>
</block>